#ifndef HPLC_SPARKLINK_CHECKPACKET_H
#define HPLC_SPARKLINK_CHECKPACKET_H

#include "basesendpacket.h"
#include "hplcsparklinkautosamplerpfcid.h"
#include "hplcsparklinkprotocolcommondata.h"

namespace hplc
{
namespace sparklink
{

//class HplcSparkLinkProtocolCommonData;
class HplcSparkLinkCheckPacket : public QObject
{
    Q_OBJECT

public:
    HplcSparkLinkCheckPacket(HplcSparkLinkProtocolCommonData &data, QObject *parent = nullptr);
    ~HplcSparkLinkCheckPacket();

    void setMaxWaitTime(quint32 ms);
    quint32 getMaxWaitTime();

    QByteArray getReply();
    Reply getReplyCode();

    void replyCheck(char re);
    void replyCheck(HplcSparkLinkAutoSamplerPfcId pfc);

    // 等待回复
    void waitReply(HplcSparkLinkAutoSamplerPfcId pfc = HplcSparkLinkAutoSamplerPfcId_None);

    void send();

public slots:
    void onBaseTickTimeout();

signals:
    void nack();
    void nack0();
    void noReply();

protected:
    HplcSparkLinkProtocolCommonData *m_d;
};

} // sparklink
} // hplc


#endif // HPLC_SPARKLINK_CHECKPACKET_H
